﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Sunlit.Business.Commerces.Dto
{
    [AutoMap(typeof(CommerceCate))]
    public class CommerceCateDto : EntityDto, IHasCreationTime
    {
        /// <summary>
        /// 类别名称
        /// </summary>
        [Required(ErrorMessage = "请输入类别名称")]
        [StringLength(256, ErrorMessage = "类别名称的最大长度为{1}个字符")]
        public string Name { get; set; }
        /// <summary>
        /// 图片地址
        /// </summary>
        public string ImageUrl { get; set; }
        /// <summary>
        /// 首页显示
        /// </summary>
        public bool ShowOnHome { get; set; }
        /// <summary>
        /// 简单描述
        /// </summary>
        [StringLength(512)]
        public string ShortDesc { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }

        public int? ParentId { get; set; }
        public virtual CommerceCateDto Parent { get; set; }
        public ICollection<CommerceCateDto> Children { get; set; }

        /// <summary>
        /// 包含的政策咨询
        /// </summary>
        public virtual ICollection<CommerceDto> Commerces { get; set; }
    }
}
